package com.HZNU.spring_api.Service;

import com.HZNU.spring_api.POJO.Dept;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

//降级
@Component
public class DeptClientFallBack implements FallbackFactory {
    @Override
    public DeptClientService create(Throwable throwable) {
       return new DeptClientService() {
            @Override
            public Dept get(int id) {
                return new Dept().setDeptno(id).setDname("服务已经关闭");
            }
        };
    }
}
